export default class Event<T> {
  private readonly listener: ((arg?: T) => void)[] = []
  emit(arg?: T) {
    this.listener.forEach((fun) => fun(arg))
  }
  on(fun: (arg?: T) => void) {
    this.listener.push(fun)
  }
}
